package com.jianyun.jyzs.bean;

import android.os.Parcel;
import android.os.Parcelable;

import cn.rongcloud.rce.lib.model.GroupInfo;

/**
 * Created by yangshijun on 2018/7/16.
 */

public class SelectedContactInfo implements Parcelable {
    private String contactId;
    private String name;
    private String portraitUrl;
    private String departPath;
    private String departName;
    private String phoneNumber;
    private boolean checkable = true;
    private int defaultIcon;
    private GroupInfo.GroupType groupType;

    public SelectedContactInfo() {
    }

    protected SelectedContactInfo(Parcel in) {
        contactId = in.readString();
        name = in.readString();
        portraitUrl = in.readString();
        departPath = in.readString();
        departName = in.readString();
        checkable = in.readByte() != 0;
        defaultIcon = in.readInt();
        phoneNumber = in.readString();
    }

    public static final Creator<SelectedContactInfo> CREATOR = new Creator<SelectedContactInfo>() {
        @Override
        public SelectedContactInfo createFromParcel(Parcel in) {
            return new SelectedContactInfo(in);
        }

        @Override
        public SelectedContactInfo[] newArray(int size) {
            return new SelectedContactInfo[size];
        }
    };

//    public Conversation.ConversationType getConversationType() {
//        return conversationType;
//    }
//
//    public void setConversationType(Conversation.ConversationType conversationType) {
//        this.conversationType = conversationType;
//    }


    public int getDefaultIcon() {
        return defaultIcon;
    }

    public void setDefaultIcon(int defaultIcon) {
        this.defaultIcon = defaultIcon;
    }

    public String getId() {
        return contactId;
    }

    public void setId(String contactId) {
        this.contactId = contactId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPortraitUrl() {
        return portraitUrl;
    }

    public void setPortraitUrl(String portraitUrl) {
        this.portraitUrl = portraitUrl;
    }

    public String getDepartPath() {
        return departPath;
    }

    public void setDepartPath(String departPath) {
        this.departPath = departPath;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public boolean isCheckable() {
        return checkable;
    }

    public GroupInfo.GroupType getGroupType() {
        return groupType;
    }

    public void setGroupType(GroupInfo.GroupType groupType) {
        this.groupType = groupType;
    }

    /**
     * 已选中时，是否允许点击取消。
     *
     * @param checkable
     */
    public void setCheckable(boolean checkable) {
        this.checkable = checkable;
    }

    public String getDepartName() {
        return departName;
    }

    public void setDepartName(String departName) {
        this.departName = departName;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(contactId);
        dest.writeString(name);
        dest.writeString(portraitUrl);
        dest.writeString(departPath);
        dest.writeString(departName);
        dest.writeByte((byte) (checkable ? 1 : 0));
        dest.writeInt(defaultIcon);
        //dest.writeInt(conversationType.getValue());
        dest.writeString(phoneNumber);
    }

    @Override
    public String toString() {
        return "SelectedContactInfo{" +
                "contactId='" + contactId + '\'' +
                ", name='" + name + '\'' +
                ", portraitUrl='" + portraitUrl + '\'' +
                ", departPath='" + departPath + '\'' +
                ", departName='" + departName + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", checkable=" + checkable +
                ", defaultIcon=" + defaultIcon +
                ", groupType=" + groupType +
                '}';
    }
}

